<div class="header">
    <div class="container-xxl">
        <div class="header-wrap">
            <div class="logo">
                <a href="{{modstart_web_url('')}}">
                    <img src="{{ modstart_config_asset_url('siteLogo') }}"/>
                </a>
            </div>
            <div class="menu">
                <ul class="nav-text">
                    @foreach(\MNav::all('head') as $nav)
                        @if(empty($nav['_child']))
                            <li><a href="{{ $nav['link'] }}">{{ $nav['name'] }}</a></li>
                        @else
                            <li class="dropdown">
                                <a href="{{$nav['link']}}">{{$nav['name']}}</a>
                                <div class="dropdown-text">
                                    @foreach($nav['_child'] as $child)
                                        <a href="{{$child['link']}}">{{$child['name']}}</a>
                                @endforeach
                            </li>
                        @endif
                    @endforeach
                </ul>
            </div>
            <div class="header-tool">
                <div class="search">
                    <a href="JavaScript:;" data-bs-toggle="offcanvas" data-bs-target="#search">搜索</a>
                </div>
                @if(modstart_module_enabled('Member'))
                    <div class="user">
                        <div class="login">
                            <div class="account">
                                <a href="JavaScript:;" class="portrait">
                                    <img src="{{$_memberUser['avatar']}}" />
                                </a>
                                <div class="user-body">
                                    <div class="user-head">
                                        <img src="{{$_memberUser['avatar']}}" />
                                        <div class="user-name">
                                            @if(\Module\Member\Auth\MemberUser::isLogin())
                                                <h2>{{$_memberUser['nickname']}}</h2>
                                                <p>欢迎登录</p>
                                            @else
                                                <h2>您还没有登录</h2>
                                                <p>登录之后可以开启更多功能哦</p>
                                            @endif
                                        </div>
                                    </div>
                                    <div class="user-btn">
                                        @if(\Module\Member\Auth\MemberUser::isLogin())
                                            <a href="{{modstart_web_url('member')}}">
                                                用户中心
                                            </a>
                                            <a href="{{modstart_web_url('logout')}}">
                                                退出登录
                                            </a>
                                        @else
                                            <a href="{{modstart_web_url('login')}}">
                                                <i></i>登 录
                                            </a>
                                            <a href="{{modstart_web_url('register')}}">
                                                <i></i>注 册
                                            </a>
                                        @endif
                                    </div>
                                </div>
                            </div>
                        </div>
                    </div>
                @endif
                <div class="m-btn">
                    <a href="JavaScript:;" id="navToggle"><i></i></a>
                </div>
            </div>
        </div>
    </div>
</div>
<div class="header-m">
    <div class="close">
        <img src="@asset('vendor/BlogThemeLightA/static/image/close.svg')" alt="关闭导航">
    </div>
    <div class="m-menu">
        <ul class="m-nav-text">
            @foreach(\MNav::all('head') as $nav)
                @if(empty($nav['_child']))
                    <li><a href="{{ $nav['link'] }}">{{ $nav['name'] }}</a></li>
                @else
                    <li class="dropdown">
                        <a href="{{$nav['link']}}">{{$nav['name']}}</a>
                        <div class="dropdown-text">
                            @foreach($nav['_child'] as $child)
                                <a href="{{$child['link']}}">{{$child['name']}}</a>
                        @endforeach
                    </li>
                @endif
            @endforeach
        </ul>
    </div>
</div>
